#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
int main()
{
    char s1[100] = { 0 };
    gets(s1);
    int t1 = strlen(s1);
    int i = 0;
    for (i = 0; i < t1; i++)
    {
        if ('a' <= s1[i] && s1[i] <= 'z')
            s1[i] = s1[i] - 32;
        else if ('A' <= s1[i] && s1[i] <= 'Z')
            s1[i] = s1[i] + 32;
    }

    for (i = 0; i < t1; i++)
    {
        printf("%c", s1[i]);
    }
    return 0;
}